<?php
/**
 * CSS parser class
 * 
 * TODO:
 */
class CssParser {
    public $css = array();
    protected $_order_id = 0;
    public function addStyleSheet($text)
    {
        // Remove comments
        $text = preg_replace("/\/\*(.*)?\*\//Usi", "", $text);
        $styles = array();
        $_tmp = explode('}', $text);
        foreach ($_tmp as $style) {
            $style = explode('{',$style);
            if (isset($style[1])) {
                $styles[] = array('key'=>trim($style[0]), 'value'=>trim($style[1]));
            }
        }
        echo '<pre>';
        print_r($styles);
    }
}
?>